package be.redo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import be.redo.dao.ContinentDAO;
import be.redo.model.entities.Continent;

@Service
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED)
public class ContinentServiceImpl implements ContinentService {

	@Autowired
	ContinentDAO dao;

	@Override
	@Transactional(readOnly = false)
	public void create(Continent instance) {
		dao.create(instance);
	}

	@Override
	public Continent read(long id) {
		return dao.read(id);
	}

	@Override
	@Transactional(readOnly = false)
	public void update(Continent instance) {
		dao.update(instance);
	}

	@Override
	@Transactional(readOnly = false)
	public void delete(long id) {
		dao.delete(id);
	}

	@Override
	public List<Continent> findAll() {
		return dao.findAll();
	}

	@Override
	public int count() {
		return dao.count();
	}

	@Override
	public List<Continent> findContinentsByNameLike(String name) {
		return dao.findContinentsByNameLike(name);
	}
}
